/**
 * 机构树
 */
user.organTree = user.organTree || Ext.extend(Ext.tree.TreePanel,{
	initComponent:function(){
			var tree = this;
		     Ext.apply(this,{
				title : '部门',
				root : this.getRoot(),
				rootVisible:false,
				loader : new Ext.tree.TreeLoader({
					baseAttrs : {},
					dataUrl : 'organ/getOrganTree.jhtml',
					listeners: {
						'beforeload':function(treeloader, node) {
							treeloader.baseParams = {
								id: node.id,
								method: 'POST'
							};
						}
					}
				}),
		       tools : [{
						id : 'refresh',
						handler : function() {
						   tree.root.reload();
						}
				}],
				collapsible : true,
				width : 160,
				minSize : 160,
				maxSize : 280,
				split : true,
				region : 'west',
				autoScroll : true
		     });
		     user.organTree.superclass.initComponent.call(this);
	    },
	    //private
		getRoot : function(){
		    return new Ext.tree.AsyncTreeNode({
				id : '0',
				text :'根节点',
				expanded : true
			});
	    }
});